<!--
1. component
    1. Vue提供了component 来展示对应名称的组件
    2. component是一个占位符
    3. :is 属性可以用来指定要展示的组件的名称
2. Vue提供的标签
    1. component
    2. template
    3. transition
    4. transition-group
-->


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue.js"></script>
</head>
<body>
    <div id="app">
        <a href="" @click.prevent="comName='login'">登录</a>
        <a href="" @click.prevent="comName='register'">注册</a>
        <component :is="comName"></component>
    </div>

    <script>

        Vue.component('login',{
            template:"<h3>登录页面</h3>"
        });

        Vue.component('register',{
            template: "<h3>注册页面</h3>"
        });

        var vm=new Vue({
            el:"#app",
            data:{
                comName:''
            },
            methods:{

            }
        })
    </script>
</body>
</html>